<template>
  <el-container>
    <el-aside width="200px">
      <el-menu
        active-text-color="#ffd04b"
        background-color="#545c64"
        class="el-menu-vertical-demo"
        :default-active="$route.path"
        text-color="#fff"
        router
      >
        <el-menu-item index="/gongzuo">
          <el-icon><icon-menu /></el-icon>
          <span>工作台</span>
        </el-menu-item>
        <el-sub-menu index="1">
          <template #title>
            <el-icon><location /></el-icon>
            <span>行车管理</span>
          </template>
          <el-menu-item index="/card">月卡管理</el-menu-item>
          <el-menu-item index="/qiye">企业管理</el-menu-item>
        </el-sub-menu>
      </el-menu>
    </el-aside>
    <el-container>
      <el-header>
        <el-button type="info" @click="exit">退出</el-button>
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script lang="ts" setup>
import { ref, reactive } from "vue";
import { Location, Document, Menu as IconMenu } from "@element-plus/icons-vue";
import { useRouter } from "vue-router";
import { ElMessage } from "element-plus";
import "element-plus/es/components/message/style/css";
const router = useRouter();
const exit = () => {
  localStorage.removeItem("token");
  ElMessage.success("退出成功");
  router.push("/");
};
</script>

<style lang="scss" scoped>
.el-aside {
  height: 100vh;
  background-color: #545c64;
}
</style>
